#pragma once

#include <cassert>
#include <string>
#include "CaseSettings.h"
#include "ModelSettings.h"
#include "WallGeometry.h"
#include "Particle.h"
#include "Cphase.h"
#include "mathParticleTracking.h"
#include "ImpingementParameter.h"

using namespace std;
class WallImpingement
{
public:
	// default constructor
	WallImpingement() { pVelNormal2Wall = 0.0; pVelTang2Wall = 0.0; 
	    ImpingePara = ImpingementParameter();}
	// main constructor
	WallImpingement(Flag& pFlag, const shared_ptr<ModelSettings> modelSetting0,
		const shared_ptr<CaseSettings> caseSetting0, Particle& pIn,
		const shared_ptr<WallGeometry> wallGeometry0, const ImpingementParameter& ImpingePara_in);

	// calcuate the impingment parameters: direction, angle, normal/tangetial veloctiy
	void ImpactAngleCorrect(const vector<double>& norm0, const vector<double>& lineLeft, 
		const vector<double>& lineRight, const vector<double>& vp,
		double& directionP, double& angleP, double& normalVel, double& tangVel);

	// calculate the normal and tangetial velocity
	void WallVelocity(const vector<double>& v0, const double& directionP, const double& angleP,
		double& normalVel, double& tangVel);

	double pVelNormal2Wall; // particle velocity normal to wall
	double pVelTang2Wall;   // particle velocity tangential to wall
	ImpingementParameter ImpingePara; // particle impingement parameter, distance to boundary and boundary type
};

